package io.renren.modules.wmhistory.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.wmhistory.dao.WmhistoryDao;
import io.renren.modules.wmhistory.entity.WmhistoryEntity;
import io.renren.modules.wmhistory.service.WmhistoryService;


@Service("wmhistoryService")
public class WmhistoryServiceImpl extends ServiceImpl<WmhistoryDao, WmhistoryEntity> implements WmhistoryService {

    @Autowired
    WmhistoryDao wmhistoryDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<WmhistoryEntity> page = this.page(
                new Query<WmhistoryEntity>().getPage(params),
                new QueryWrapper<WmhistoryEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<WmhistoryEntity> getWmHistory(String wName, String startTime, String endTime) {
        return wmhistoryDao.getWmHistory(wName,startTime,endTime);
    }

}